# n = 0
# for i in 'http://www.baidu.com':
#     n += 1
# print(n)

# def a():
#     print('11111')
# a()

# def login():
#     username = input('用户名:')
#     password = input('密码:')
#     if username == 'root' and password == '123':
#         print('登录成功！')
#     else:
#         print('登录失败！')
# login()

# def area(width,height):
#     return width*height
#
# def print_welcome(name):
#     print("Welcome",name)
#
# print_welcome("Fred")
# w = 4
# h = 5
# print("width=",w,"height=",h,"area=",area(w,h))

# a = 4
# def print_func1():
#     a = 17
#     print("in print_func a = ", a)
# def print_func2():
#     print("in print_func a=",a)
# print_func1()
# print_func2()
# print("a = ",a)

# def parrot(voltage,state='a stiff',action='voom',type='Norwegian Blue'):
#     print("-- This parrot wouldn't", action, end=' ')
#     print("if you put", voltage, "volts through it.")
#     print("-- Lovely plumage, the", type)
#     print("-- It's", state, "!")
# parrot(1000)                                          # 1 positional argument
# parrot(voltage=1000)                                  # 1 keyword argument
# parrot(voltage=1000000, action='VOOOOOM')             # 2 keyword arguments
# parrot(action='VOOOOOM', voltage=1000000)             # 2 keyword arguments
# parrot('a million', 'bereft of life', 'jump')         # 3 positional arguments
# parrot('a thousand', state='pushing up the daisies')  # 1 positional, 1 keyword

# def return_sum(x,y):
#     c = x + y
#     return c
# res = return_sum(4,5)
# print(res)

# def arithmetic_mean(*args):
#     if len(args) == 0:
#         return 0
#     else:
#         sum = 0
#         for x in args:
#             sum += x
#             return  sum/len(args)
#
# print(arithmetic_mean(45,32,89,78))
# print(arithmetic_mean(8989.8,78787.78,3453,78778.73))
# print(arithmetic_mean(45,32))
# print(arithmetic_mean(45))
# print(arithmetic_mean())